package com.goods.business.converter;

import com.goods.common.model.business.Supplier;
import com.goods.common.model.system.Department;
import com.goods.common.model.system.User;
import com.goods.common.vo.business.SupplierVO;
import com.goods.common.vo.system.UserVO;
import org.springframework.beans.BeanUtils;
import org.springframework.util.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author ：MJS
 * @date ：Created in 2021/6/8  13:53
 * @description：TODO
 */
public class SupplierConverter {
/*    *//**
     * 转voList
     * @param suppliers
     * @return
     *//*
    public List<SupplierVO> converterToSupplierVOList(List<Supplier> suppliers){
        List<SupplierVO> userVOS=new ArrayList<>();
        if(!CollectionUtils.isEmpty(suppliers)){
            for (Supplier supplier: suppliers) {
                SupplierVO supplierVO = converterToUserVO(supplier);
                userVOS.add(supplierVO);
            }
        }
        return userVOS;
    }

    *//**
     * 转vo
     * @return
     *//*
    public  UserVO converterToSupplierVO(Supplier supplier){
        SupplierVO supplierVO = new SupplierVO();
        BeanUtils.copyProperties(supplier,supplierVO);
        supplierVO.setStatus(supplier.getStatus() == 0);
        Department department = departmentMapper.selectByPrimaryKey(user.getDepartmentId());
        if(department!=null&&department.getName()!=null){
            userVO.setDepartmentName(department.getName());
            userVO.setDepartmentId(department.getId());
        }
        return userVO;
    }*/
}
